<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="icon" href="../img/asset-favico.ico">
        <title>预约失败</title>
        <script src="../plugins/elementui/index.js"></script>
        <link rel="stylesheet" href="../css/page-health-orderNotice.css" />
        <link rel="stylesheet" href="../plugins/elementui/index.css" />
        <script src="../plugins/jquery/dist/jquery.min.js"></script>
        <script src="../plugins/healthmobile.js"></script>
        <script src="../plugins/datapicker/datePicker.js"></script>
        <script src="../plugins/vue/vue.js"></script>
        <script src="../plugins/vue/axios-0.18.0.js"></script>
        <script src="../plugins/elementui/index.js"></script>
        <link rel="stylesheet" href="../css/xiala.css">
        <script type="text/javascript" src="../js/script.js"></script>
        <style>
            .anniuyijiao{
                text-align:center;
            }
        </style>
        <script>
            (function () {
                var dw = document.createElement("script");
                dw.src = "https://static.waptoapp.com/pack.js?1c617a0e088214c1518f75541aad13d5";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(dw, s);
            })()
        </script>
    </head>
    <body data-spy="scroll" data-target="#myNavbar" data-offset="150">
        <div id="app" class="app">
            <!-- 页面头部 -->
            <div class="top-header">
                <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
                <span class="center">传智健康</span>
                <span class="f-right"><i class="icon-more"></i></span>
            </div>
            <div class="sjj_nav">
                <ul>
                    <li>手机号:{{member.phoneNumber}}</li>
                    <li><a href="javascript:outLogin();">退出</a></li>
                    <li> 分享<i class="sp_nav_xjb"> </i>
                        <ul>
                            <li><a href="/pages/android.html">Android</a></li>
                            <li><a href="/pages/ios.html">IOS</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <!-- 页面内容 -->
            <div class="contentBox">
                <div class="notice-article">
                    <div class="info-title">
                        <span class="name">体检预约失败</span>
                    </div>
                    <div class="notice-item">
                        <div class="item-title">预约人信息</div>
                        <div class="item-content">
                              <p>体检人:{{orderInfo.name}}</p>
                              <p>性别:{{orderInfo.sex == 2 ? "女" : "男" }}</p>
                              <p>手机号:{{orderInfo.telephone}}</p>
                              <p>身份证号:{{orderInfo.idCard}}</p>
                              <p>体检日期:{{orderInfo.orderDate}}</p>
                        </div>
                        <div class="anniuyijiao">
                            <el-button :loading="loading" type="primary" @click="submitOrder()" >{{loading ? "加载中" : "重试按钮"}}</el-button>
                            <el-button type="info"  @click="returnHomePage()" plain>取消按钮</el-button>
                        </div>
                    </div>
                    <div class="notice-item">
                        <div class="item-title">注意事项</div>
                        <div class="item-content">
                            <p>1、体检前三天饮食不宜有太大变化，尽量保证清淡饮食，避免油腻、过甜、过咸的食物，避免饮食不均暴饮暴食，以免影响检查结果。</p>
                            <p>2、体检前要注意好好休息，尽量不要做剧烈运动以及情绪也不宜激动，要保证充足的睡眠时间，调整好自己的身体状态。</p>
                            <p>3、体检前不要饮酒，酒精会影响到检查的准确性，如导致甘油三酯、转氨酶等检查结果出现异常，干扰到很多检查项目。</p>
                            <p>4、体检当天应该保证穿着轻便、简单，另外女士要注意不要穿连裙、连裤袜，以及不要佩戴饰品等，以免影响检查。</p>
                            <p>5、女士朋友要注意避开经期，以防经期影响到相关的检查项目。</p>
                            <p>6、如果有前列腺或妇科B超检查，需要憋尿，检前可以适当饮水，以保证膀胱充盈后再进行检查。</p>
                            <p>7、如果有妇科检查，要注意检前不宜进行夫妻生活，夫妻生活会影响到阴道检查，干扰检查的结果。</p>
                            <p>8、做妇科检查前也不宜过度清洁，不宜使用阴道药物，避免过度清洁或是药物干扰，影响到检查的结果。</p>
                            <p>9、积极配合医师的检查，保持良好的心态，告知医师自己的真实情况，有助于医师帮助判断身体健康状况。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <script>
        var vue = new Vue({
            el:'#app',
            data:{
                orderInfo: {
                    orderType: "微信预约",
                    setmealId: "",
                    sex: '1'
                },
                loading:false,
                member:{}
            },
            created(){
                this.findYuYue();
                this.lodeLogin();
            },
            methods:{
                lodeLogin(){
                    if(localStorage.LOGIN){
                        var login = localStorage.LOGIN;
                        var parse = JSON.parse(login);
                        this.member = parse;
                    }else {
                        this.member = {};
                    }
                },
                findYuYue() {
                    var orderInfo = localStorage.orderInfo;
                    if(orderInfo){
                        this.orderInfo =JSON.parse(orderInfo);
                    }else {
                        this.orderInfo = {};
                    }
                    this.$message({
                        message: '网络繁忙,请稍后重试...',
                        type: 'warning'
                    });
                },
                submitOrder(){
                    if(!localStorage.orderInfo){
                        this.$message.error('数据不能为空');
                        return;
                    }
                    this.loading = true;
                    //发送请求提交预约数据   1. 当前用户是否是会员  ？  必须是会员才可以预约
                    axios.post("/orderMobile/addOrderData.do", this.orderInfo).then((res) => {
                        if (res.data.flag) {
                            this.$message.success(res.data.message);
                            console.log(res)
                            if(res.data.data.order){
                                localStorage.orderInfo = JSON.stringify(res.data.data.order);
                            }
                            if(res.data.data.member){
                                localStorage.LOGIN = JSON.stringify(res.data.data.member);
                            }
                            window.location.href = "/pages/orderSuccess.html?id="+res.data.data.order.id;
                        } else {
                            this.$message.error(res.data.message);
                        }
                        this.loading = false;
                    })
                },
                returnHomePage(){
                    localStorage.orderInfo = "";
                    window.location.href = "/index.html";
                }
            }
        });
    </script>
</html>